import React, { useContext } from "react";
import { ValueContext } from "../..";

const ContextCard = () => {
  const context = useContext(ValueContext);

  return (
    <div
      onClick={() => {
        context?.handleValue?.(context.value++);
      }}
    >
      {context.value}
    </div>
  );
};

export default ContextCard;
